/* 智能体问答系统样式 */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    height: 100vh;
    overflow: hidden;
}

.container-fluid {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 聊天消息样式 */
.message {
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease-in;
}

.message-user {
    text-align: right;
}

.message-ai {
    text-align: left;
}

.message-content {
    display: inline-block;
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
}

.message-user .message-content {
    background-color: #007bff;
    color: white;
    border-bottom-right-radius: 4px;
}

.message-ai .message-content {
    background-color: #e9ecef;
    color: #333;
    border-bottom-left-radius: 4px;
}

.message-system .message-content {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    font-size: 0.9em;
    text-align: center;
    max-width: 90%;
}

.message-timestamp {
    font-size: 0.75em;
    color: #6c757d;
    margin-top: 4px;
}

/* 任务样式 */
.task-item {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    background-color: white;
    transition: all 0.2s ease;
}

.task-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.task-item.task-pending {
    border-left: 4px solid #6c757d;
}

.task-item.task-running {
    border-left: 4px solid #007bff;
    background-color: #f8f9ff;
}

.task-item.task-completed {
    border-left: 4px solid #28a745;
    background-color: #f8fff8;
}

.task-item.task-failed {
    border-left: 4px solid #dc3545;
    background-color: #fff8f8;
}

.task-header {
    display: flex;
    justify-content-between;
    align-items: center;
    margin-bottom: 8px;
}

.task-status {
    font-size: 0.8em;
    padding: 2px 8px;
    border-radius: 12px;
}

.task-status.status-pending {
    background-color: #6c757d;
    color: white;
}

.task-status.status-running {
    background-color: #007bff;
    color: white;
}

.task-status.status-completed {
    background-color: #28a745;
    color: white;
}

.task-status.status-failed {
    background-color: #dc3545;
    color: white;
}

.task-description {
    font-size: 0.9em;
    line-height: 1.4;
    color: #495057;
}

.task-actions {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e9ecef;
}

.task-actions .btn {
    font-size: 0.8em;
    padding: 2px 8px;
}

/* 进度条样式 */
.progress {
    height: 6px;
    border-radius: 3px;
}

.progress-bar {
    transition: width 0.3s ease;
}

/* 输入区域样式 */
#question-input {
    border: none;
    box-shadow: none;
    resize: none;
}

#question-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* 连接状态指示器 */
#connection-status.connected {
    background-color: #28a745 !important;
}

#connection-status.disconnected {
    background-color: #dc3545 !important;
}

#connection-status.connecting {
    background-color: #ffc107 !important;
    color: #000 !important;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.typing-dots {
    animation: pulse 1.5s infinite;
}

/* 滚动条样式 */
.overflow-auto::-webkit-scrollbar {
    width: 6px;
}

.overflow-auto::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.overflow-auto::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.overflow-auto::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .row {
        flex-direction: column;
    }
    
    .col-8, .col-4 {
        max-width: 100%;
        flex: none;
    }
    
    .col-8 {
        height: 60vh;
    }
    
    .col-4 {
        height: 40vh;
    }
    
    .message-content {
        max-width: 90%;
    }
}

/* 实用工具类 */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-xs {
    padding: 0.125rem 0.25rem;
    font-size: 0.75rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}

.cursor-pointer {
    cursor: pointer;
}

.user-select-none {
    user-select: none;
}